package com.sword.onlysword.web.controller;

import com.sword.onlysword.entity.Sudoku;
import com.sword.onlysword.mapper2.TestMapper;
import com.sword.onlysword.service.games.SudokuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * com.sword.onlysword.web.controller.IndexController
 * Created by SwordLiu on 2018-02-02.
 */
@Controller
public class IndexController {

    @Autowired
    private SudokuService sudokuService;
    @Autowired
    private TestMapper testMapper;

    @RequestMapping("/index")
    public String index() {
        return "index";
    }

    @RequestMapping("/test")
    public String test() {
        Sudoku sudoku = new Sudoku();
        sudoku.setName("啦啦");
        sudoku.setTime(65L);
        sudoku.setDifficulty(3);
        boolean b = sudokuService.sudokuScore(sudoku);
        System.out.println(b);
        int count = testMapper.count();
        System.out.println(count);
        return "test";
    }

}
